home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / virus / dukakisa.sit / Dukakis Anti-Virus Script next >
Encoding:
Text File  |  1988-11-08  |  3.2 KB  |  91 lines  |  [TEXT/MSWD]

  1.  
  2. ---------------------- Cut here -------------------------------
  3. -- Note: "Duk-akis" contains a dash here to prevent the vaccine from
  4. -- detecting itself as a virus.
  5.  
  6. -- Script to detect the spread of the "Duk-akis" virus. It works by
  7. -- trapping the "set" command. I havenUt seen "Duk-akis", but I should
  8. -- think that it works by setting the scripts of various objects to
  9. -- whatever they were plus an "on openStack" handler. Well, by trapping
  10. -- the "set" command, we can then find out if we are setting a script.
  11. -- If we are, then we can sort of work like "Vaccine" does; i.e., we
  12. -- prompt the user to see if he or she wants to allow the command to
  13. -- continue. If it is stopped, then all scripts are halted.
  14.  
  15. -- Additionally, if the script contains the word "Duk-akis", then no
  16. -- option is given & the script is halted straight away.
  17.  
  18. -- THIS SCRIPT SHOULD BE INSTALLED IN THE "HOME" STACK,
  19. -- IN THE STACK SCRIPT.
  20.  
  21. -- You can test this script by making a new stack, then keying the
  22. -- following examples into the message box:
  23. -- % "Set the script of this stack to empty"
  24. -- % "Set the script of this stack to field 1"
  25. -- % "set the script of this stack to Duk-akis" (don't type the dash)
  26.  
  27. -- Try it, I think you'll like it!
  28.  
  29. -- This script is free to everyone apart from the person who wrote the
  30. -- "Duk-akis" virus. I just hope it affects every single stack he or
  31. -- she has or gets in the future!
  32.  
  33. -- Regards to all from a truely devoted HyperCard fan,
  34. -- Ian Summerfield
  35. -- Technical Support Supervisor
  36. -- Apple Computer UK Ltd.
  37. -- CIS: 76657, 742
  38. -- "Sysop" - AppleFone HyperCard BBS: Luton, England: 0582 584134
  39.  
  40. -- Modified slightly 8/22/88 by Joe McMahon to make sure that
  41. --"set the scriptI" (vs. "set script") doesn't slip through.
  42.  
  43. -- Modified a bit more 8/29/88 by Joe McMahon to add Ian's fixes
  44. -- to prevent the vaccine from detecting itself as a virus.
  45.  
  46. on set
  47.   put "Duk"&"akis" into duk
  48.   if the param of 1 is "script" or the param of 2 is "script" then
  49.     get the params
  50.     if last word of it is "to" then put it && "empty" into it
  51.     put it into s
  52.     if s contains duk then
  53.       repeat 10
  54.         play harpsichord tempo 300 "a b c b a b c b"
  55.       end repeat
  56.       answer duk&&"virus detected!" with "Halt scripts"
  57.       answer "Okay, you're safe now! It didn't spread."
  58.       exit to HyperCard
  59.     end if
  60.     play harpsichord tempo 200 "e c e c e c e"
  61.     answer "Warning: Script change requested" with "Show me"
  62.     repeat
  63.       answer s with "Allow" or "Stop!" or "Show more"
  64.       if it is "Allow" then pass set
  65.       else
  66.         if it is "Stop!" then
  67.           answer "All scripts halted!"
  68.           exit to HyperCard
  69.         else
  70.           put the userLevel into userSafe
  71.           set userLevel to 5
  72.           doMenu "New Field"
  73.           get the number of card fields
  74.           set rect of card field it to 0,19,512,342
  75.           set style of card field it to scrolling
  76.           put the params into card field it
  77.           choose browse tool
  78.           wait until not the mouseClick
  79.           wait until the mouseClick
  80.           choose field tool
  81.           click at loc of card field it
  82.           doMenu "Clear Field"
  83.           choose browse tool
  84.           set userLevel to userSafe
  85.         end if
  86.       end if
  87.     end repeat
  88.   else pass set
  89. end set
  90.  
  91.